package com.hundsun.yr.universal.p2p.bean;

import com.hundsun.yr.universal.library.utils.MathUtils;

import java.io.Serializable;

/**
 * Created by xx on 2017/5/3.
 * 托管账户信息
 */
public class BankAccountBeen implements Serializable{
    /**
     * availBal : 96020.00
     * bankCard : 6228480310586187111
     * cert_no : 330327199302238799
     * cert_type : 1
     * ctime : 2017-04-24 18:43:22
     * currBal : 100020.00
     * depository_bank_mobile : 15726816079
     * depository_bank_no : 6212461270000160511
     * email :
     * first_buy_flag : 0
     * id : 180
     * inviter :
     * last_check_notice : 0
     * level : 1
     * nick_name : 15726816079
     * open_channel : 11
     * passwd : 30303030303030303030303030303030D9D952BD99C0FA741C2F7C856397327249D5EAB7
     * phone : 15726816079
     * score : 0
     * set_paypwd_flag : 1
     * status : 0
     * token : 201705031410316f9c912d38ce94b7bbcfe4e222bcbb03ac2622a211bcf4f551
     * true_name : 徐顺圳
     * user_no : 20170424184322874077
     * utime : 0000-00-00 00:00:00
     * vip : 0
     */

    public String availBal;
    public String bankCard;
    public String cert_no;
    public String cert_type;
    public String ctime;
    public String currBal;
    public String depository_bank_mobile;
    public String depository_bank_no;
    public String email;
    public String first_buy_flag;
    public String id;
    public String inviter;
    public String last_check_notice;
    public String level;
    public String nick_name;
    public String open_channel;
    public String passwd;
    public String phone;
    public String score;
    public String set_paypwd_flag;
    public String status;
    public String token;
    public String true_name;
    public String user_no;
    public String utime;
    public String vip;
    /**
     * alliance_code : null
     * province : null
     * city : null
     * district : null
     * address : null
     * fdd_id : null
     * bankName : 平安银行（借记卡）
     */

    public Object alliance_code;
    public Object province;
    public Object city;
    public Object district;
    public Object address;
    public Object fdd_id;
    public String bankName;

    /**
     * 获得理财资产
     * @return
     */
    public String getFinancialAssets(){
        return String.valueOf(Double.valueOf(currBal) - Double.valueOf(availBal));
    }

    /**
     * 获得Progress里面的值
     * @return
     */
    public float displayProgress(){
        float progress= MathUtils.string2float(MathUtils.division(availBal,
                MathUtils.plus(availBal,getFinancialAssets())));
        return progress;
    }

    @Override
    public String toString() {
        return "BankAccountBeen{" +
                "availBal='" + availBal + '\'' +
                ", bankCard='" + bankCard + '\'' +
                ", cert_no='" + cert_no + '\'' +
                ", cert_type='" + cert_type + '\'' +
                ", ctime='" + ctime + '\'' +
                ", currBal='" + currBal + '\'' +
                ", depository_bank_mobile='" + depository_bank_mobile + '\'' +
                ", depository_bank_no='" + depository_bank_no + '\'' +
                ", email='" + email + '\'' +
                ", first_buy_flag='" + first_buy_flag + '\'' +
                ", id='" + id + '\'' +
                ", inviter='" + inviter + '\'' +
                ", last_check_notice='" + last_check_notice + '\'' +
                ", level='" + level + '\'' +
                ", nick_name='" + nick_name + '\'' +
                ", open_channel='" + open_channel + '\'' +
                ", passwd='" + passwd + '\'' +
                ", phone='" + phone + '\'' +
                ", score='" + score + '\'' +
                ", set_paypwd_flag='" + set_paypwd_flag + '\'' +
                ", status='" + status + '\'' +
                ", token='" + token + '\'' +
                ", true_name='" + true_name + '\'' +
                ", user_no='" + user_no + '\'' +
                ", utime='" + utime + '\'' +
                ", vip='" + vip + '\'' +
                ", alliance_code=" + alliance_code +
                ", province=" + province +
                ", city=" + city +
                ", district=" + district +
                ", address=" + address +
                ", fdd_id=" + fdd_id +
                ", bankName='" + bankName + '\'' +
                '}';
    }
}
